//package com.example.gradle.test;
//
//import org.junit.jupiter.api.BeforeEach;
//import org.junit.jupiter.api.DisplayName;
//import org.junit.jupiter.api.Test;
//import org.junit.runner.RunWith;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
//import org.springframework.boot.test.context.SpringBootTest;
//import org.springframework.test.context.junit4.SpringRunner;
//import org.springframework.test.web.servlet.MockMvc;
//import org.springframework.test.web.servlet.MvcResult;
//import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
//import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
//
//import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
//
//@RunWith(SpringRunner.class) //使用spring测试运行器，以便加载spring上下文
//@AutoConfigureMockMvc //自动配置MockMvc，以便测试spring mvc控制器
//@SpringBootTest(classes = com.example.gradle.test.Application.class) //指定要测试的spring boot应用程序
//public class ApplicationTest {
//
//    @Autowired
//    private MockMvc mockMvc;
//
//
//    @DisplayName("测试hello接口-前置")
//    @BeforeEach
//    public void mockMvc(){
//        System.out.println("准备开始执行了");
//    }
//
//    @DisplayName("测试hello接口-执行")
//    @Test
//    public void execute() throws Exception {
//        MvcResult hello = mockMvc.perform(MockMvcRequestBuilders.get("hello"))
//                .andExpect(status().isOk())
//                .andDo(MockMvcResultHandlers.print())
//                .andReturn();
//        System.out.println(hello.getResponse().getContentAsString());
//    }
//
//
//}
